// Copyright (C) ustc9703
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-9-27

#include "stdafx.h"
#include ".\usercontainer.h"

//##ModelId=44C4B5D90370
CJoyUserContainer::CJoyUserContainer(void)
{
    m_skinArea = true;
    m_name = "user_container";
    m_align = AT_Bottom;
    m_centerWidth = 80;
}

//##ModelId=44C4B5D9037B
CJoyUserContainer::~CJoyUserContainer(void)
{
}

BEGIN_MESSAGE_MAP(CJoyUserContainer, CJoyWndContainer)
    ON_WM_SIZE()
END_MESSAGE_MAP()

//##ModelId=44C4B5D9036D
void CJoyUserContainer::CM_LoadSkin(CJoyXmlElement* pSkinElem)
{
    __super::CM_LoadSkin(pSkinElem);

    m_centerWidth = pSkinElem->ReadIntD("center", 80);
}

//##ModelId=44C4B5D9037E
void CJoyUserContainer::OnSize(UINT nType, int cx, int cy)
{
    int m;
    if(cx <= m_centerWidth)
    {
        m = 0;
    }
    else
    {
        m = (cx-m_centerWidth)/2;
    }
    m_margin.left   = m;
    m_margin.right  = m;

    CJoyWndContainer::OnSize(nType, cx, cy);
}
